﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Libs.Security;

/// <summary>
/// Summary description for Logs
/// </summary>
public class Logs
{
	public Logs()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public static void Add(string task, string description, string content)
    {
        if (HttpContext.Current.Session["UserID"] == null)
        {
            return;
        }

        UserLog _UserLog = new UserLog();
        _UserLog.UserID = AppUtils.UserID;
        _UserLog.UserName = AppUtils.UserName;
        _UserLog.Url = HttpContext.Current.Request.RawUrl.ToLower().Replace(Constant.ADMIN_PATH.ToLower(), "");
        _UserLog.Task = task;
        _UserLog.Description = description;
        _UserLog.Content = content;
        _UserLog.Add();
    }

}